package com.nanhai.buddhist.college.module.collegebase.dal.mysql.classroomfunction;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.collegebase.dal.dataobject.classroomfunction.ClassroomFunctionDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.classroomfunction.vo.*;

/**
 * 教室功能 Mapper
 *
 * @author AKai
 */
@Mapper
public interface ClassroomFunctionMapper extends BaseMapperX<ClassroomFunctionDO> {

    default PageResult<ClassroomFunctionDO> selectPage(ClassroomFunctionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassroomFunctionDO>()
                .likeIfPresent(ClassroomFunctionDO::getFunctionName, reqVO.getFunctionName())
                .betweenIfPresent(ClassroomFunctionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ClassroomFunctionDO::getCreateTime));
    }

    default List<ClassroomFunctionDO> selectList(ClassroomFunctionExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ClassroomFunctionDO>()
                .likeIfPresent(ClassroomFunctionDO::getFunctionName, reqVO.getFunctionName())
                .betweenIfPresent(ClassroomFunctionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ClassroomFunctionDO::getCreateTime));
    }

}
